package com.blackto.lib.mediat;

import com.blackto.lib.mediat.core.Mediator;
import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@Data
@ComponentScan
@ConditionalOnClass(Mediator.class)
public class MediatorConfig {
    @Bean
    public Mediator mediator(ApplicationContext context){
        return new Mediator(context);
    }
}
